package cn.cn77.futures;

import android.os.Bundle;
import android.view.View;
import cn.cn77.futures.utils.MyApplication;
import cn.cn77.futures.utils.UpdateManager;
import cn.cn77.futures.widget.NavigationBar;

public class MainActivity extends BaseActivity {
	private NavigationBar naviBar;
	private UpdateManager mUpdateManager;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		MyApplication.getInstance().addActivity(this);
		naviBar = (NavigationBar) findViewById(R.id.main_navi_bar);
		naviBar.setTitle("期货软件");
	}

	public void toNextActivity(View v) {
		switch (v.getId()) {
		case R.id.tv_new_product:
			toActivity(this, NewProductActivity.class);
			break;
		case R.id.tv_success_rate:
			toActivity(this, SuccessRateActivity.class);
			break;
		case R.id.tv_intro:
			toActivity(this, IntroductionActivity.class);
			break;
		case R.id.tv_update:
			mUpdateManager = new UpdateManager(this);
			mUpdateManager.checkUpdate();
			break;
		case R.id.tv_finish:
			MyApplication.getInstance().exit();
			break;
		}
	}
}
